/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package control;

import global.ServerInfor;
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;

/**
 *
 * @author kUN
 */
public class getWeekNow {
    public static int DateNow(){
        
         HttpConnection http = null;
         InputStream iStrm = null;  
         boolean bRes = false;
         String url = ServerInfor.url + "/mobile/getWeek.aspx";
            try
        {
          http = (HttpConnection) Connector.open(url);
          http.setRequestMethod(HttpConnection.GET);
          iStrm = http.openInputStream();      
          bRes = ProcessServerResponse.ServerResponse(http, iStrm);
          
        }catch(IOException ex)
        {
            //ShowAlert.ShowAlert(display, frm, "Lỗi kết nối", "Không  thể kết nối với Server", 3);
        }
        finally
        {
            try
            {
              if (iStrm != null)
                iStrm.close();
              if (http != null)
                http.close();
            }
            catch(IOException ex){}
        }
        
        
        int kq=Integer.parseInt(global.Global.sServerRespon);
        return kq;
    
    }
    
}
